/*
 * Selling Partner API for Orders
 *
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.orders.v0
{
    /// <summary>
    /// Measurement information for an order item.
    /// </summary>
    [DataContract(Name = "Measurement")]
    public partial class Measurement : IValidatableObject
    {
        /// <summary>
        /// The unit of measure.
        /// </summary>
        /// <value>The unit of measure.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum UnitEnum
        {
            /// <summary>
            /// Enum OUNCES for value: OUNCES
            /// </summary>
            [EnumMember(Value = "OUNCES")]
            OUNCES = 1,

            /// <summary>
            /// Enum POUNDS for value: POUNDS
            /// </summary>
            [EnumMember(Value = "POUNDS")]
            POUNDS = 2,

            /// <summary>
            /// Enum KILOGRAMS for value: KILOGRAMS
            /// </summary>
            [EnumMember(Value = "KILOGRAMS")]
            KILOGRAMS = 3,

            /// <summary>
            /// Enum GRAMS for value: GRAMS
            /// </summary>
            [EnumMember(Value = "GRAMS")]
            GRAMS = 4,

            /// <summary>
            /// Enum MILLIGRAMS for value: MILLIGRAMS
            /// </summary>
            [EnumMember(Value = "MILLIGRAMS")]
            MILLIGRAMS = 5,

            /// <summary>
            /// Enum INCHES for value: INCHES
            /// </summary>
            [EnumMember(Value = "INCHES")]
            INCHES = 6,

            /// <summary>
            /// Enum FEET for value: FEET
            /// </summary>
            [EnumMember(Value = "FEET")]
            FEET = 7,

            /// <summary>
            /// Enum METERS for value: METERS
            /// </summary>
            [EnumMember(Value = "METERS")]
            METERS = 8,

            /// <summary>
            /// Enum CENTIMETERS for value: CENTIMETERS
            /// </summary>
            [EnumMember(Value = "CENTIMETERS")]
            CENTIMETERS = 9,

            /// <summary>
            /// Enum MILLIMETERS for value: MILLIMETERS
            /// </summary>
            [EnumMember(Value = "MILLIMETERS")]
            MILLIMETERS = 10,

            /// <summary>
            /// Enum SQUAREMETERS for value: SQUARE_METERS
            /// </summary>
            [EnumMember(Value = "SQUARE_METERS")]
            SQUAREMETERS = 11,

            /// <summary>
            /// Enum SQUARECENTIMETERS for value: SQUARE_CENTIMETERS
            /// </summary>
            [EnumMember(Value = "SQUARE_CENTIMETERS")]
            SQUARECENTIMETERS = 12,

            /// <summary>
            /// Enum SQUAREFEET for value: SQUARE_FEET
            /// </summary>
            [EnumMember(Value = "SQUARE_FEET")]
            SQUAREFEET = 13,

            /// <summary>
            /// Enum SQUAREINCHES for value: SQUARE_INCHES
            /// </summary>
            [EnumMember(Value = "SQUARE_INCHES")]
            SQUAREINCHES = 14,

            /// <summary>
            /// Enum GALLONS for value: GALLONS
            /// </summary>
            [EnumMember(Value = "GALLONS")]
            GALLONS = 15,

            /// <summary>
            /// Enum PINTS for value: PINTS
            /// </summary>
            [EnumMember(Value = "PINTS")]
            PINTS = 16,

            /// <summary>
            /// Enum QUARTS for value: QUARTS
            /// </summary>
            [EnumMember(Value = "QUARTS")]
            QUARTS = 17,

            /// <summary>
            /// Enum FLUIDOUNCES for value: FLUID_OUNCES
            /// </summary>
            [EnumMember(Value = "FLUID_OUNCES")]
            FLUIDOUNCES = 18,

            /// <summary>
            /// Enum LITERS for value: LITERS
            /// </summary>
            [EnumMember(Value = "LITERS")]
            LITERS = 19,

            /// <summary>
            /// Enum CUBICMETERS for value: CUBIC_METERS
            /// </summary>
            [EnumMember(Value = "CUBIC_METERS")]
            CUBICMETERS = 20,

            /// <summary>
            /// Enum CUBICFEET for value: CUBIC_FEET
            /// </summary>
            [EnumMember(Value = "CUBIC_FEET")]
            CUBICFEET = 21,

            /// <summary>
            /// Enum CUBICINCHES for value: CUBIC_INCHES
            /// </summary>
            [EnumMember(Value = "CUBIC_INCHES")]
            CUBICINCHES = 22,

            /// <summary>
            /// Enum CUBICCENTIMETERS for value: CUBIC_CENTIMETERS
            /// </summary>
            [EnumMember(Value = "CUBIC_CENTIMETERS")]
            CUBICCENTIMETERS = 23,

            /// <summary>
            /// Enum COUNT for value: COUNT
            /// </summary>
            [EnumMember(Value = "COUNT")]
            COUNT = 24
        }


        /// <summary>
        /// The unit of measure.
        /// </summary>
        /// <value>The unit of measure.</value>
        [DataMember(Name = "Unit", IsRequired = true, EmitDefaultValue = true)]
        public UnitEnum Unit { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="Measurement" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected Measurement() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="Measurement" /> class.
        /// </summary>
        /// <param name="unit">The unit of measure. (required).</param>
        /// <param name="value">The measurement value. (required).</param>
        public Measurement(UnitEnum unit = default(UnitEnum), decimal value = default(decimal))
        {
            this.Unit = unit;
            this.Value = value;
        }

        /// <summary>
        /// The measurement value.
        /// </summary>
        /// <value>The measurement value.</value>
        [DataMember(Name = "Value", IsRequired = true, EmitDefaultValue = true)]
        public decimal Value { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class Measurement {\n");
            sb.Append("  Unit: ").Append(Unit).Append("\n");
            sb.Append("  Value: ").Append(Value).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
